<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        //整形：integer  缩写为 int  浮点数：float
        //1.字符串转化为number
        let score = '90.2'
        score = parseInt(score);//90
        console.log(typeof score);

        let ccore = '80.8'
        score = parseFloat(score)//80.8
        console.log(typeof score);//数据类型为number


        //2.not a number
        score = parseInt('李白');//NaN
        console.log(score);



        //3.强制转化为 number
        let age = Number('666');
        console.log(typeof age);  //number
    </script>
</body>

</html>